package br.com.mayco.persistence;

import br.com.mayco.util.StringUtil;
import java.io.Serializable;
import javax.faces.context.FacesContext;

/**
 * @author Mayco Lucian
 * @since 25/02/2013
 * version 1.0.0
 */

public class DatabaseConfig implements Serializable {

    public static String PERSISTENCE = "";

    static {
        try {
            if (StringUtil.isNullOrEmpty(PERSISTENCE)) {
                FacesContext ctx = FacesContext.getCurrentInstance();
                PERSISTENCE = ctx.getExternalContext().getInitParameter("PersistenceUnit");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}